#include <iostream>
using namespace std;
int main()
{
    int A,B;
    while(cin>>A&&cin>>B)
    {
        int flag1 = A&B;
        int flag2 = A^B;
        while(flag1 > 0)
        {
         	int C = flag1<<1;
    		int D = flag2;

            flag1 = C&D;
            flag2 = C^D;
        }
     cout << flag2 << endl;
    }
    return 0;
}

